<template>
	<view class="cacheConfigUration">
		<view class="illustrate">
			开启缓存会加快客户端访问速度哟，如果没有特殊需求，不要关闭哟。关闭或开启需重启客户端生效。
		</view>
		<view class="option">
			<view
				@click="clickOption(true)"
				:class="cacheConfigUration.value?'hover':''">开启</view>
			<view
				@click="clickOption(false)"
				:class="!cacheConfigUration.value?'hover':''">关闭</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				cacheConfigUration:false
			}
		},
		onLoad() {
			this.cacheConfigUration = uni.getStorageSync('cacheConfigUration');
			console.log(this.cacheConfigUration)
		},
		methods: {
			clickOption(type){
				uni.setStorageSync('cacheConfigUration', {'value':type});
				this.cacheConfigUration = uni.getStorageSync('cacheConfigUration');
			}
		}
	}
</script>

<style lang="scss">
.cacheConfigUration{
	.illustrate{
		background: $BeiJingSe;
		margin: 25rpx;
		margin-bottom: 0;
		border: 1rpx solid $BianKuangSe;
		padding: 25rpx;
	}
	.option{
		width: 700rpx;
		margin: 25rpx;
		display: flex;
		justify-content:space-between;
		view{
			width: 337.5rpx;
			height: 100rpx;
			display: flex;
			align-items: center;
			justify-content: center;
			background: $BianKuangSe;
		}
		.hover{
			background: $LanSe;
			color: #FFF;
		}
	}
}
</style>
